package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.SysJob;
import com.ruoyi.system.api.factory.RemoteJobFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 定时服务
 */
@FeignClient(contextId = "CreateJobService", value = ServiceNameConstants.JOB_SERVICE, fallbackFactory = RemoteJobFallbackFactory.class)
public interface RemoteJobService {
    /**
     * 新建定时任务
     *
     * @param
     * @return
     */
    @PostMapping(value = "/job")
    public AjaxResult add(@RequestBody SysJob job);
    /**
     * 删除定时任务
     *
     * @param
     * @return
     */
    @PostMapping(value = "/job/delete")
    public AjaxResult delete(@RequestBody String resId);
}

